<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="utf-8" />
		<title>个人信息</title>
		<link rel="stylesheet" type="text/css" href="css/public.css"/>
		<link rel="stylesheet" type="text/css" href="css/mygxin.css" />
		<script src="js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="X-admin/lib/layui/layui.js"></script>
		<script src="X-admin/js/jquery.js"></script>
		<script src="X-admin/js/xadmin.js"></script>
		<link rel="stylesheet" href="X-admin/css/xadmin.css">
	</head>
	<body>
		<!------------------------------head------------------------------>
		<div class="head ding">
			<div class="wrapper clearfix">
				<div class="clearfix" id="top">
					<h1 class="fl"><a href="index.html"><img src="img/logo.png"/></a></h1>
					<div class="fr clearfix" id="top1">
						<p class="fl">
							<a href="#" id="login">登录</a>
							<a href="#" id="reg">注册</a>
						</p>
						<form action="#" method="get" class="fl">
							<input type="text" placeholder="搜索" />
							<input type="button" />
						</form>
						<div class="btn fl clearfix">
							<a href="mygxin.html"><img src="img/grzx.png"/></a>
							<a href="#" class="er1"><img src="img/ewm.png"/></a>
							<a href="cart.html"><img src="img/gwc.png"/></a>
							<p><a href="#"><img src="img/smewm.png"/></a></p>
						</div>
					</div>
				</div>
				<ul class="clearfix" id="bott">
					<li><a href="index.html">首页</a></li>
					<li>
						<a href="#">所有商品</a>
						<div class="sList">
							<div class="wrapper  clearfix">
								<a href="paint.html">
									<dl>
										<dt><img src="img/nav1.jpg"/></dt>
										<dd>浓情欧式</dd>
									</dl>
								</a>
								<a href="paint.html">
									<dl>
										<dt><img src="img/nav2.jpg"/></dt>
										<dd>浪漫美式</dd>
									</dl>
								</a>
								<a href="paint.html">
									<dl>
										<dt><img src="img/nav3.jpg"/></dt>
										<dd>雅致中式</dd>
									</dl>
								</a>
								<a href="paint.html">
									<dl>
										<dt><img src="img/nav6.jpg"/></dt>
										<dd>简约现代</dd>
									</dl>
								</a>
								<a href="paint.html">
									<dl>
										<dt><img src="img/nav7.jpg"/></dt>
										<dd>创意装饰</dd>
									</dl>
								</a>
							</div>
						</div>
					</li>
					<li>
						<a href="flowerDer.html">装饰摆件</a>
						<div class="sList2">
							<div class="clearfix">
								<a href="proList.html">干花花艺</a>
								<a href="vase_proList.html">花瓶花器</a>
							</div>
						</div>
					</li>
					<li>
						<a href="decoration.html">布艺软饰</a>
						<div class="sList2">
							<div class="clearfix">
								<a href="zbproList.html">桌布罩件</a>
								<a href="bzproList.html">抱枕靠垫</a>
							</div>
						</div>
					</li>
					<li><a href="paint.html">墙式壁挂</a></li>
					<li><a href="perfume.html">蜡艺香薰</a></li>
					<li><a href="idea.html">创意家居</a></li>
				</ul>
			</div>
		</div>
		<!------------------------------idea------------------------------>
		<div class="address mt" id="add">
			<div class="wrapper clearfix">
				<a href="index.html" class="fl">首页</a>
				<span>/</span>
				<a href="mygxin.html" class="on">个人中心</a>
			</div>
		</div>
		
		<!------------------------------Bott------------------------------>
		<div class="Bott">
			<div class="wrapper clearfix">
				<div class="zuo fl">
					<h3>
						<a href="#"><img src="img/default.jpeg" style="width: 100px;height: 100px;border-radius:60%" id="zuo-head"/></a>
						<p class="clearfix"><span class="fl" id="name">[羊羊羊]</span><span class="fr">[退出登录]</span></p>
					</h3>

					<ul class="layui-nav layui-nav-tree" lay-filter="test">
						<li class="layui-nav-item">
							<a href="javascript:;" style="color: black;font-weight: bold">帐户管理</a>
							<dl class="layui-nav-child">
								<dd><a href="lessors-mygrxx.html">个人信息</a></dd>
								<dd><a href="lessors-remima.html">修改密码</a></dd>
							</dl>
						</li>
						<li class="layui-nav-item">
							<a href="javascript:;" style="color: black;font-weight: bold">财务中心</a>
							<dl class="layui-nav-child">
								<dd><a href="lessors-fiance.html">财务细明</a></dd>
								<dd><a href="lessors-fiance-dailyList.html">日报</a></dd>
								<dd><a href="lessors-fiance-monthlyList.html">月报</a></dd>
							</dl>
						</li>
						<li class="layui-nav-item">
							<a href="javascript:;" style="color: black;font-weight: bold">个人中心</a>
							<dl class="layui-nav-child">
								<dd><a href="lessors-station.html">我的工位</a></dd>
								<dd><a href="lessors-activity.html">我的活动</a></dd>
							</dl>
						</li>
					</ul>

				</div>
				<div class="you fl">
					<div class="tx clearfix">
						<div class="fl clearfix">
							<a href="#" class="fl"><img style="width: 100px;height: 100px;border-radius:60%" id="avatar"/></a>
							<p class="fl"><span id="userna"></span><a href="mygrxx.html">修改个人信息></a></p>
						</div>
						<div class="fr" id="emails"></div>
					</div>
					<div class="layui-card-header">
						<!--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除
                        </button>-->
						<button class="layui-btn" onclick="xadmin.open('添加工位','lessors-activity-add.html',800,600)"><i
								class="layui-icon"></i>添加
						</button>
					</div>
					<div class="layui-card-body ">
						<form class="layui-form layui-col-space5">
<!--							<div class="layui-inline layui-show-xs-block">-->
								<!--<select id="states" name="states" class="valid">
									<option value="2">全部状态</option>
									<option value="1">开启状态</option>
									<option value="0">关闭状态</option>
								</select></div>-->
							<div class="layui-inline layui-show-xs-block">
								<input type="text" id="remark" placeholder="活动内容（备注）" autocomplete="off" class="layui-input">
							</div>
							<div class="layui-inline layui-show-xs-block">
								<input type="text" id="crtime" placeholder="发布时间" autocomplete="off" class="layui-input">
							</div>
							<div class="layui-inline layui-show-xs-block">
								<select id="enable" name="enable" class="valid">
									<option value="">全部状态</option>
									<option value="1">开启状态</option>
									<option value="0">关闭状态</option>
								</select>
							</div>
							<div class="layui-inline layui-show-xs-block">
								<button class="layui-btn" lay-submit="" lay-filter="sreach">
									<i class="layui-icon">查询</i></button>
							</div>
						</form>

						<table id="commentList" lay-filter="test" style="text-align: center">
						</table>
						<script type="text/html" id="barDemo">
							<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="edit">编辑</a>
							<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
						</script>
					</div>
				</div>
			</div>
		</div>

		<!--返回顶部-->
		<div class="gotop">
			<a href="cart.html">
			<dl>
				<dt><img src="img/gt1.png"/></dt>
				<dd>去购<br />物车</dd>
			</dl>
			</a>
			<a href="#" class="dh">
			<dl>
				<dt><img src="img/gt2.png"/></dt>
				<dd>联系<br />客服</dd>
			</dl>
			</a>
			<a href="mygxin.html">
			<dl>
				<dt><img src="img/gt3.png"/></dt>
				<dd>个人<br />中心</dd>
			</dl>
			</a>
			<a href="#" class="toptop" style="display: none">
			<dl>
				<dt><img src="img/gt4.png"/></dt>
				<dd>返回<br />顶部</dd>
			</dl>
			</a>
			<p>400-800-8200</p>
		</div>
		<div class="footer">
			<div class="top">
				<div class="wrapper">
					<div class="clearfix">
						<a href="#2" class="fl"><img src="img/foot1.png"/></a>
						<span class="fl">7天无理由退货</span>
					</div>
					<div class="clearfix">
						<a href="#2" class="fl"><img src="img/foot2.png"/></a>
						<span class="fl">15天免费换货</span>
					</div>
					<div class="clearfix">
						<a href="#2" class="fl"><img src="img/foot3.png"/></a>
						<span class="fl">满599包邮</span>
					</div>
					<div class="clearfix">
						<a href="#2" class="fl"><img src="img/foot4.png"/></a>
						<span class="fl">手机特色服务</span>
					</div>
				</div>
			</div>
			<p class="dibu">最家家居&copy;2013-2017公司版权所有 京ICP备080100-44备0000111000号<br />
			违法和不良信息举报电话：400-800-8200，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试</p>
		</div>
		<script src="js/public.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/user.js" type="text/javascript" charset="utf-8"></script>

	</body>

	<script>
		var Address_Prefix = "http://localhost:9200/api-lessors";
		$(function () {
			start();
		});

		function start() {
			layui.use(['table', 'form','laydate'], function () {
				var table = layui.table;
				var form = layui.form;
				var laydate=layui.laydate;
				laydate.render({
					elem: '#crtime'
				});
				getRender();

				// 模糊查询----监听查询按钮
				form.on('submit(sreach)', function () {
					getRender();
					return false;
				});
				table.on('tool(test)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
					var data = obj.data; //获得当前行数据
					// 编辑
					if (obj.event === 'edit') {
						xadmin.open('编辑活动信息', 'lessors-activity-edit.html', 1200, 600);
						sessionStorage.setItem("actiid",data.actiid)
					}
					// 删除
					else if (obj.event === 'del') {
						layer.confirm('真的删除行么', function () {
							console.log(data);
							$.ajax({
								url: Address_Prefix + '/activity2/data/del',//地址：访问后台的地址
								data: {actiid: data.actiid},//前端传递给后台的数据
								type: 'get',
								async: false,
								dataType: 'json',//是后端传递到前端的数据格式
								success: function (data) {//后端给前端的一个反馈
									console.log(data);
									if (data.code === 0) {
										layer.msg("ok！",{time:1000},function () {
											location.reload();
										})
									}else {
										layer.msg("Not ok！",{time:1000})
									}
								}
							});
						});
					}

				});
			});
		}


		function getRender(){
			layui.use(['table'], function () {
				var table = layui.table;
				table.render({
					elem: '#commentList',
					url: Address_Prefix+"/activity2/data/findByPage",
					where: {
						bussid: sessionStorage.getItem("busiid"),
						remark: $("#remark").val(),
						crtime: $("#crtime").val(),
						enable: $("#enable").val(),
					},
					parseData: function (res) {
						console.log(res);
						return {
							"code": 0,
							"msg": "",
							"count": res.data.total,
							"data": res.data.list
						}
					}
					, page: true//开启分页
					, cellMinWidth: 80
					, cols: [[
						{field: 'zizeng', title: 'id', width: 100,fixed: 'left',type: 'numbers'},
						{field: 'bussid', title: '商家id',hide: true},
						{field: 'reduce', title: '折扣'},
						{field: 'crtime', title: '发布时间'},
						{field: 'remark', title: '备注'},
						{field: 'starts', title: '开始时间'},
						{field: 'endtim', title: '结束时间'},
						{field: 'enable', title: '状态',templet: function (o) {
								if (o.enable==1){
									return '启用';
								}else {
									return '停用';
								}
							} },
						{field: 'aclass', title: '活动分类',templet: function (o) {
								if (o.aclass==1){
									return '平台活动';
								} else {
									return '商家活动';
								}
							} },
						{fixed: 'right', title: '操作', width: 150, align: 'center', toolbar: '#barDemo'}
					]]
				});
			});
		}


	</script>
</html>
